// date format: d MMM yyyy, H:mm, time should be specifed based on UTC time

// 新闻弹窗
import { memo, type JSX } from "react";

import { ARBITRUM } from "./chains";
import { getIncentivesV2Url } from "./links";
import { getNormalizedTokenSymbol } from "./tokens";

import TokenIcon from "components/TokenIcon/TokenIcon";

export type EventData = {
  id: string;
  title: string;
  isActive?: boolean;
  startDate?: string;
  endDate: string;
  bodyText: string | string[] | JSX.Element;
  chains?: number[];
  link?: {
    text: string;
    href: string;
    /**
     * @default false
     */
    newTab?: boolean;
  };
};

export const homeEventsData: EventData[] = [];

const TokenSymbolWithIcon = memo(({ symbol }: { symbol: string }) => (
  <span className="whitespace-nowrap">
    <TokenIcon className="relative -top-3" symbol={symbol} displaySize={14} importSize={40} />
    &nbsp;{symbol}
  </span>
));

export const appEventsData: EventData[] = [
  {
    id: "pepe-and-wif-markets-arbitrum",
    title: "弹窗新闻",
    isActive: true,
    // 开始时间
    startDate: "17 Jul 2024, 00:00",
    // 结束时间
    endDate: "01 Aug 2024, 00:00",
    // 显示内容
    bodyText: (
      <>
        Trade <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("DOGE")} />,{" "}
        <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("BNB")} />,{" "}
        <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("SOL")} />,{" "}
        <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("LTC")} />,{" "}
        <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("LINK")} />
        {" and "}
        <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("XRP")} /> with up to 100x leverage,
        <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("ARB")} /> with up to 75x leverage and{" "}
        <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("ATOM")} />,{" "}
        <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("AVAX")} />
        {" and "}
        <TokenSymbolWithIcon symbol={getNormalizedTokenSymbol("UNI")} /> with up to 60x on Arbitrum.
      </>
    ),
    // 链接
    link: {
      text: "Read more",
      href: getIncentivesV2Url(ARBITRUM),
      newTab: true,
    },
  },
];
